const axios = require('axios')

let arr = [
    "https://blog.csdn.net/qq_42451776/article/details/118330610",
    "https://blog.csdn.net/qq_42451776/article/details/118279223",
    "https://blog.csdn.net/qq_42451776/article/details/117482081",
    "https://blog.csdn.net/qq_42451776/article/details/118547574",
    "https://blog.csdn.net/qq_42451776/article/details/118459259",

    "https://blog.csdn.net/qq_42451776/article/details/118641236",
    "https://blog.csdn.net/qq_42451776/article/details/118637322",
    "https://blog.csdn.net/qq_42451776/article/details/118636421",
    "https://blog.csdn.net/qq_42451776/article/details/118565472",
    "https://blog.csdn.net/qq_42451776/article/details/118548495",

    "https://blog.csdn.net/qq_42451776/article/details/118490804",
    "https://blog.csdn.net/qq_42451776/article/details/118388755",
    "https://blog.csdn.net/qq_42451776/article/details/118445615",
    "https://blog.csdn.net/qq_42451776/article/details/118407808",
    "https://blog.csdn.net/qq_42451776/article/details/118397731",

    "https://blog.csdn.net/qq_42451776/article/details/117537180",
    "https://blog.csdn.net/qq_42451776/article/details/118345475",
    "https://blog.csdn.net/qq_42451776/article/details/118327405?spm=1001.2014.3001.5501",
    "https://blog.csdn.net/qq_42451776/article/details/118325319?spm=1001.2014.3001.5501",
]

let time = 3000
var timer = null
function sleep() {
    clearTimeout(timer)
    return new Promise((res) => {
        timer = setTimeout(() => { res() }, time)
    })
}

function api(url){
    axios.get(url)
}
setInterval(async () => {
    api(arr[0])
    await sleep()
    api(arr[1])
    await sleep()
    api(arr[2])
    await sleep()
    api(arr[3])
    await sleep()
    api(arr[4])
    await sleep()
    api(arr[5])
    await sleep()
    api(arr[6])
    await sleep()
    api(arr[7])
    await sleep()
    api(arr[8])
    await sleep()
    api(arr[9])
    await sleep()
    api(arr[10])
    await sleep()
    api(arr[11])
    await sleep()
    api(arr[12])
    await sleep()
    api(arr[13])
    await sleep()
    api(arr[14])
    await sleep()
    api(arr[15])
    await sleep()
    api(arr[16])
    await sleep()
    api(arr[17])
    // await sleep()
    // api(arr[18])
    // await sleep()
    // api(arr[19])
    // await sleep()
    // api(arr[20])
    // await sleep()
    // api(arr[21])
    // await sleep()
    // api(arr[22])
}, time*(arr.length+1))
